import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
@Injectable({
  providedIn: 'root'
})
export class QrcodeconfigService {
  data = '/QRCode'
  constructor(private http:HttpClient) { }
  createQRCodeConfiguration(data:any){
    return this.http.post(`${environment.apiUrl}${this.data}/CreateQRCodeConfiguration`,data)
  }
  deleteQRCodeConfiguration(id:any){
    const DeleteQRCodeConfiguration = '/DeleteQRCodeConfiguration';
    const options = {
      body: id,
      responseType: 'text' as 'json'
    };
    return this.http.delete(environment.apiUrl+ this.data+DeleteQRCodeConfiguration,options);
  }// 删除员工
  getQRCodeConfigurationById(id:any){
    return this.http.get(`${environment.apiUrl}${this.data}/GetQRCodeConfigurationById?id=${id}`)
  }
  getQRCodeConfigurations(OrderType:any,PageNumber:any,PageSize:any){
    return this.http.get(`${environment.apiUrl}${this.data}/GetQRCodeConfigurations?OrderType=${OrderType}&PageNumber=${PageNumber}&PageSize=${PageSize}`)
  }
  getOrderCodeConfigurationEnum(orderType:any){
    return this.http.get(`${environment.apiUrl}${this.data}/GetOrderCodeConfigurationEnum?orderType=${orderType}`)
  }
  updateQRCodeConfiguration(data:any,id:any){
    return this.http.put(`${environment.apiUrl}${this.data}/UpdateQRCodeConfiguration`,data,{params:{id:id}})
  }
}



